Repository navigation
Notebook: three code cells (1. Install, 2. Mount Google Drive, 3. Run preprocessing) - #267
Merged
Merged
Conversation
Owner request of 10 November 2026, as in ZeroCostDL4Mic and NucleiSky: the single code cell of the shipped notebook is split into 1. Install MorphoBricks preprocessing, 2. Mount Google Drive and 3. Run preprocessing, each under a Markdown heading that explains it. RELEASE_REF, the install target and PreprocessingNotebook(describe=True) are unchanged. Cell 2 prints a one-line note outside Colab. Cell 3 run before cell 1 stops naming cell 1 (not an ImportError), and on Colab without Drive it stops naming cell 2; no cell runs another. Tests: the three cells in order and each one's part, Colab-only code inside the guard (ast), cell 1 run twice installs once, the cells out of order, and real-kernel runs with and without a faked google.colab and of cell 3 alone. Docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
The fixture stays within the code rules' 60 executable lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
A Windows temporary path in a Python string literal holds backslash escapes; the forward-slash form is the same folder there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner request of 10 November 2026. Like the lab's ZeroCostDL4Mic and NucleiSky notebooks,
notebooks/MorphoBricks_Preprocessing.ipynbnow has three code cells instead of one. Each cell sits under a Markdown heading that explains it.Unchanged:
RELEASE_TAGv0.5.0,RELEASE_REFfd7afd339bcaab7579c806a28a65bb7ecebe940c, the install target and extras,DEVELOPMENT_OVERRIDE,SETUP_RECORD, andPreprocessingNotebook(describe=True)with the samedisplay(app). This PR changes only how the code is split into cells, the Markdown, and the docs and tests that describe them. The v0.5.1 release PR movesRELEASE_REFlater.The cells
# @title 1. Install MorphoBricks preprocessing: the previous bootstrap code without the Drive mount. It still checks for a nearby checkout, an installed package or the pinned GitHub install, setsEXTRAStonotebook,zarron Colab, checks thatnotebook_uiimports, and prints the version report followed by "Next: run cell 2 …, then cell 3 …". It does not ask for a restart. Running it again installs nothing that is already there (tested).# @title 2. Mount Google Drive:drive.mount("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/content/drive")inside the Colab guard, with the same refusal as before when the mount fails. Outside Colab it prints one line: "Not Google Colab: there is no Google Drive to mount here, so nothing was done." It raises no error there.# @title 3. Run preprocessing: builds and displays the app.SETUP_RECORDwas never filled, it stops with aRuntimeErrorsaying "run cell 1 (Install MorphoBricks preprocessing) first". That covers a fresh kernel and a cell 1 that failed. It does not fail with anImportError./content/drive/MyDrive, it stops and names cell 2. Nothing falls back silently to the runtime's disk.The code-cell metadata is copied from the old cell (source hidden, JupyterLab hide-code lock).
Tests
tests/test_notebook_file.py:_install_preprocessing.RELEASE_CALLSandrelease_call()are kept. Exactly onePreprocessingNotebook(...)call across all cells, and it is in cell 3./contentstrings andgoogleimports appear only inside the Colab guard. No magics.google.colab; and cell 3 alone in a fresh kernel, which must give aRuntimeErrornaming cell 1.tests/test_notebook_setup.py:/content/driveis replaced by a temporary folder that the fakedrive.mountfills.Docs
docs/colab-release-check.mdsection A: the smoke check now covers the three cells, including running them out of order and running cell 1 twice.docs/user_guide.md§1 and its Colab section,README.md,AGENTS.md(Notebook target row, the notebook-file tests, §7 code cells), the plan's Q58 amendment and a CHANGELOG "Unreleased" entry.Verification
python tools/check.pyon f67bea0 (main 78cda50 merged in, including SWEEP-PP (A): remove the remaining compatibility code (PP-05..PP-10) and fix the frozen clock (#262) #265 and SWEEP-PP (B): experiment_design.csv is output only, and the pairing card is rebuilt on the draft (PP-02) #266): ruff check and format clean, 5163 passed, 4 skipped, code rules clean.\U…escape error, which made 16 notebook tests fail on Windows CI for f67bea0. After that commit, the notebook tests and code rules were run locally (58 passed). CI on 6a2f37d is green on all 7 jobs (lint, and ubuntu/macos/windows × 3.11/3.13).test_cli_log.py:166,test_folder_rules.py:199andtest_folder_rules.py:230: the file system tells names apart by case;test_discovery.py:665: running as root ignores file modes.🤖 Generated with Claude Code
https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc